/*
 * BInit_328P.h
 *
 * Created: 3/07/2014 9:36:25 PM
 *  Author: MacGyver
 */ 


#ifndef BINIT_328P_H_
#define BINIT_328P_H_

#define F_CPU				16000000UL 	// Fuse for internal oscillator at 16MHz

#define PORT_INPUT			0
#define PORT_OUTPUT			1

#define PULLUP_INACTIVE		0
#define PULLUP_ACTIVE		1

#define SET_BIT(src, val, bit)		(unsigned char)((src & (1<<bit)) | val)
#define CLEAR_BIT(src, val, bit)	(~(src & (1<<bit)) & val)

void BINI_vInitPorts(void);
void BINI_vSetPortDirection( char cPort, unsigned char u8Bit, bool boState );
void BINI_vSetPortPullUp( char cPort, unsigned char u8Bit, bool boState );
void BINI_vWritePort( char cPort, unsigned char u8Bit, bool boState );
unsigned short BINI_u8ReadPort( char cPort, unsigned char u8Bit );

#endif /* BINIT_328P_H_ */